fixed selection problems + more minor changes