Fixes potential sources of bugs, but not #43