Fixed bug 'CGContextTranslateCTM: invalid context 0x0'

Credits: mdb983