Fixed exceptions, added some argument checks, added a way to call an anonymous function