Added logic to handle null value for DateTime types which was causing NullPointerException.
Fixed the wrong, unchecked type casting of String to Date which resulted in ClassCastException