Fixes 14, 15,17, 18

Fixes #14, #15, #17, #18

See comments on issues