Issue32

Fixed #32. Recreated issue32 branch and implemented bug fix.