Small fixes from @l0g0sys

Copied the small fixes done by @l0g0sys.