Fixed some context issues. Haven't compiled and tested it yet #16