Fixed horizontal alignment, added more robust validation