Fixed unintended recursion (closes #45)