Fixed several Bugs,added some cases of chained calls