small fixes to code