License header update and minor bug fixes