Fix compatibility bugs introduced in last commit