fixes for @memmett's comments