added tests for Compile(), discovered and fixed a bug as a result