Added argument checks + related tests + related javadoc