fixed bad warning() and error() subroutines