Some bugfixes.

Signed-off-by: Sebastián J. Seba <ssebastianj@gmail.com>