Added more error code tests;
Added checking of variable type when it is used as index of an array