Fixed bug when a 'notice' and 'error' variables are not defined