Fixing some bugs in 3.0