Fixed several bugs involving /dev mounting, and two in the emulated realpath function