Fixed several bugs...