fixed a few bugs left over from last time