Fixes based on comments from tjm