Fixining some minor bugs - unable to get closures working