Fix bug save & type handling