Bugs fixed! Thanks to @pleclech