Fix compile error

Based on patch found on http://patchwork.ozlabs.org/patch/396684/.