Final commit and bug fixes