Few bug fixes after last commit. Still some left...