fixes #16 fixes #15, fixes #14, fixes #5