Fix bug with def