Capitalized error messages
Added type check tests for nonlocal and global statements