Hi @majamaki
You might be passing the wrong data to your functions, have you tried to var_dump your variables, are they returning the expected results?
Please checkout the following tutorial on debugging ACF data here: http://www.advancedcustomfields.com/resources/debug/