fixes based on @mattr-'s notes