Added profiles and fixed a couple bugs.