Some tiny bug fixes