Added strict mode and error checking