Fix bugs in -base handling