Error log and minor fixes