Fixed stupid bug in resource registration code.