Really? class_name works fine for me.

The form_buffers.last problem is likely that with my changes, the function will return nil instead of the form buffer if new_record is false.