Fix #2 (may introduce other bugs?)