Small bug fixes, tweaks