More tests, fixed nested ifs

Also something else? Added import? Modified ScriptSource?