Added getting precise masks.

Also fixed a mistake in line 2081.