Reimplemented ternary operator and fixed anonymous functions declarations pushing wrong value