Merged the patch from Dilyan Rusev <dilyan@jumpido.com>