Fixed generation of namespaced resource controllers. Fixes #802.