Updated copyright notice and fixed small bugs

Fix fix fix it