Fixed various bugs found in v0.7