Fixed a couple of bugs, added required options check.
It actually works now!