Fixed a bug with contexts and another bug in compiling