Fixing some bugs while testing.