options & fixes

Added support for options and made some fixes.