Fixed bugs
Added argument checking