More functions added, some fixes.