Replaced unnecessary types with auto. Closes #297.