Several improvements based in jsmanrique feedback.