Fixed bug (must learn to write a proper unit test)