fixed a few bugs, as noted in the issues form