Fixed 2 bugs found on Linux