Added a test for a single number, and fixed code