Some small fixes

This pull request fixes some small coding issues I have found starring at it for some minutes.