Remove spaces when parsing materials