Minor changes and error fix