fixed bugs, other minor fixes