Fixed more bugs. Added reset feature.