Minor changes and error fixing