Fixes from devehunt's review