fixing a few minor bugs