Improved mount function.