fix trailing spaces and new lines in tests
fix bug in autocreate
add tests