Fixed nasty linux bug which caused much :(