fixes multiple issues (#98, #99, #100)

fixes #98
fixes #99
fixes #100