Fixed all error handling, formatting issues

Population script also fixed