Makes testing more general (no test.py needed any longer).
Fixes some ProgrammingErrors.