Improve and fix bugs