Improve multiple check and add a test