Fix using #url in controllers causes NPE when testing