Cleaned code (warnings etc)

Fixes #1098 #1099 #1108
sorry, I thought they were inside tests/record.py in Theano. I fix it.