Fixed bug with preprocessor and implemented closures using maps