Fixed regex replacement race condition, added 'choice' to inline environments.