Fixed miscellaneous minor issues with syntax

and error messages.