slight enhancement for fixing notice. Also, makes the use of bp_core_add_message understand error properly