Fixes related to callbacks
Fixed error where invalid ids can be generated by the script