Fixes issue #51

Tests added