Some Minor bug fixes