fixed a few minor bugs