Minor Fixes to code