Fix return value and remove duplicate message