Some fixes

This pull request contains some fixes.