Possible fix for http://pastebin.com/F7uKLP7T @Chalkie