Bug fixes

@Zolmeister you were right about the regid thing (was undefined with how it was prev. setup)
Line 33/35?