Check that the limit switches behave properly with M114. You should be able to see them report triggered or open depending upon whether they are pressed or not.