Fixed Fatal error and Warnings added tests