Code fixes and QA