Updates to code and bug fixes.