Added error codes from SpaceDecl.h, repaired tests, added wrong length validation