fixing a few tiny bugs