Small fixes

Fixed some small bugs.