Update with fixes from OUN, thanks @barryspace