Fixes bug in #20: Double application of function