Fixed bug, closes #5