Added check for space in path

Related to #1077