Fixes #14 #15 #16 #17