removed complete exit. it causes segfault
fixed a nasty crash bug in tile calculation.