Removed dependency on experimental 'when'.