fix calcore bugs partly and add test script for calcore