misc error handling and param/constant typing edge cases.