Build fixes for Linux

see commit log for more information :)