Differentiate between errors and warnings, and added tests