Fixed options setup
Fixed various bugs