minor fixes in code