change wcwidth detection
fix some compiler warnings