Another intermediate committ. Still some bugs left.