Name resolution problem test. Also fixed a bug in subtype.