Made some minor changes and bug fixes

Made some minor changes and bug fixes.