fixed bugs as reported