Linux fixes

This branch fixes the crashing issue on linux