Fixed error when mouse hits wall.