Fixes #43, #44, #45, completes fixes for #42