Fixes #8 #16 #15