Fixed bugs for v0.1 to work properly