Fixed bug with random policy; made validation also use console.error.