Sounds like they're either floating or inverted. If you just put switches on, then make sure you enabled ENDSTOPPULLUPS in the firmware configuration. If that's set, then maybe you need to flip the X_ENDSTOPS_INVERTING depending on if you got NO or NC switches.