Added buffer usage enum. Implemented environment variables safety checks.