fix compile error on OS X. Not sure if we should have the zero argument $apply() function - its always worked so far? Have kept it in for now