Fixed some Linux/OS X compatibility stuff