Fixes #47
Fixes #49, Fixes#48, Fixes #50