Improvements no. 26

Fixed some bugs.