Bugs Fixed to make it work on Linux systems