Fixed bug closes #1