Added post-build for tests, cleaned-up code