Fixed linux code. No working window yet though.