several updates and bug fixes