Fix usage of the numpad

This fixes #49 and adds a unit test to avoid future regressions.