Fixed bug in ORM. Added logging to SQL. Added _on_save function to PostType