Fixes from @costas290