Fix some bugs due to node without type or empty. Also fix type recognition in case of complex types.