Improved mount and umount functions.