Copyright string update and several bug fixes