bug: a few bugs fixed