This should fix the last two remaining items of #798 (closed). @nicofrand can you please take a look? Thanks!