Fix some function issue and php notice on metabox