fixed a few weird bugs. Not previously documented