Fixing some fucking bugs and added improvements.