Small fixes. Should be final code.