Fixed some unused variable warnings

Closes #407