Fixed the previous issues

Unfortunately the use of immutable and the invariant contracts
had to be removed to satisfy the compiler. Interesting.