Bug-fix attempt 1.