Exposine some extra bits in the compiler and adding some tests