Fix bug #61

Two tests added as well.