Replaced all references to _begy/_begx/_maxy/_maxx to getbegy/getbegx/getmaxy/getmaxx calls.
Corrected broken if.