Fixed some compiler warnings which led to a VERY strange behaviour in the Ubuntu 14.04 terminal.