@ Some fixes in default texture/flat determination and added nicer functions to check if texture/flat exists.