Add param2 field for ores, some minor fixes and misc. code cleanup