Added more error checking for annotations