Fix #3015. Reviewed by Marc.