Minor bug fixes, tweaks