Major update and bug fixes