FIX: fix bugs by test run