Added some minor checks for variables. Fixes #201.