Multiple bug fixes