Bugs fixed + minor improvement.