TODO: some small fixes