fixed warnings, small optimization by caching shader attribs