Texture expression fix

Fixed a few of the issues mentioned by Esteban.

Signed-off-by: Marius Avram <marius.avram1309@gmail.com>
Moved prep_texture_expr inline

plus fixed bug at line 373

Signed-off-by: Marius Avram <marius.avram1309@gmail.com>
Merge pull request #503 from marius-avram/texture_expression_fix

Texture expression fix