Various updates and bug fixes