Added further checks, improve documentation