Bug-fixing, tweaks