Small fixes for rails app compatibility.