Improved vertex-generation safety code and implemented basic tap callback.