Fixed some minor bugs.
Fixed some other stuff for Qt5 support.