Some fixes (TODO: better commit message).