Bug fixed for non-interactive sessions.