Fixed #24 Invalid region bug