Fixed file system error handlers.

Also fixed a bug with the root path variable.