Add features and bug fixes