If dedicated code directory is empty, lets remove it.
Modified the 'tests' target so that if unit tests fail, the working directory is still restored.