master: fix bugs