Cleaned code (warnings etc)

Fixes #1098 #1099 #1108
It is repeated two times see (https://github.com/lisa-lab/pylearn2/blob/master/doc/library/index.txt) and then the output (http://deeplearning.net/software/pylearn2/library/index.html#libdoc)