support namespaced models and misc bug fixes