Fixed bug, minor changes