Added variable selector and fixed crash on OSX