Curry functions and nested objects fixed

@vjovanov 
Can be written in one line.