fixed unexpected unittesting bugs