moved tests into their own directory
Fixed possible use of uninitialised variable