fix some bugs; little improvement tries in MapViewer

Signed-off-by: anti-freak <antifreak2011@gmail.com>