Some bug correction in resource creation