Compile fixes and encoder formula changes