some bugfixes
Merge pull request #1 from RainPhilosopher/dev

some bugfixes