Fixes issues in #478