Minor fixes including bug fixes