Portability fixes (Qt5.1 on Linux)