Type fixes
Making resource generation more robust