Fixed some errors in last pull request.

The last pull request had some errors, this fixes them.