Improve and test the error handling of the #SPACE macro