Fixing space and cast issues