fixed wrong otherwise blocks
fixed call to non-existent method in some cases

better to use stringify