Minor bug fixes, for better integrity.